package com.keon.jianbao.bean;

import android.net.Uri;

import com.keon.jianbao.AppContext;
import com.keon.jianbao.R;

/**
 * Created by keon on 2015/9/10.
 */
public class NetWorkImg extends Entity {
    public static int TYPE_COMMON = 0;
    public static int TYPE_ADD_BTN = 1;

    public static int ACTION_ZOOM_IN = 0;
    public static int ACTION_ADD = 1;

    int type;
    int action;
    Uri uri;
    boolean isUpload;

    public int getAction() {
        return action;
    }

    public void setAction(int action) {
        this.action = action;
    }

    public NetWorkImg(int type, String uri, int action) {
        this.type = type;
        this.action = action;

        if (type == TYPE_COMMON) {
            this.uri = Uri.parse(uri);
        } else if (type == TYPE_ADD_BTN) {
            this.uri = Uri.parse("drawable://" + R.mipmap.btn_add_picture);
        }
        isUpload = false;
    }

    public NetWorkImg(int type, String uri, int action, boolean isUpload) {
        this(type, uri, action);
        this.isUpload = isUpload;
    }

    public Uri getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = Uri.parse(uri);
    }

    public boolean isUpload() {
        return isUpload;
    }

    public void setIsUpload(boolean isUpload) {
        this.isUpload = isUpload;
    }
}
